﻿namespace EFCTP5VSNH3.Model
{
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using EntityFrameworkDemo.Annotation;
using System;


    [Table("Sviluppatore")]
    public class Developer 
    {
        public virtual int Id
        {
            get;
            set;
        }

        [Required]
        [MaxLength(30, ErrorMessage = "Maximum lenght for name is 30 chars.")]
        public virtual string Name
        {
            get;
            set;
        }

        [Required]
        [ConcurrencyCheck]
        [MaxLength(30, ErrorMessage = "Maximum lenght for surname is 30 chars.")]
        public virtual string Surname
        {
            get;
            set;
        }

        //[Required]
        //[Navigation(MinLenght = 1, ErrorMessage = "A developer requires al least one skill.")]
        public virtual ICollection<Skill> Skills
        {
            get;
            set;
        }

        public virtual ICollection<Project> Projects
        {
            get;
            set;
        }
    }
}